Skip to main content

Agent components in Langflow

Agent components define the behavior and capabilities of AI agents in your flow.

Agents use LLMs as a reasoning engine to decide which of the connected tool components to use to solve a problem.

Tools in agentic functions are essentially functions that the agent can call to perform tasks or access external resources. A function is wrapped as a Tool object with a common interface the agent understands. Agents become aware of tools through tool registration where the agent is provided a list of available tools typically at agent initialization. The Tool object's description tells the agent what the tool can do.

The agent then uses a connected LLM to reason through the problem to decide which tool is best for the job.

Use an agent in a flow

The simple agent starter project uses an agent component connected to URL and Calculator tools to answer a user's questions. The OpenAI LLM acts as a brain for the agent to decide which tool to use. Tools are connected to agent components at the Tools port.

Simple agent starter flow

For a multi-agent example see, Create a problem-solving agent.

Agent component

This component creates an agent that can use tools to answer questions and perform tasks based on given instructions.

The component includes an LLM model integration, a system message prompt, and a Tools port to connect tools to extend its capabilities.

For more information on this component, see the tool calling agent documentation.

Parameters

Inputs

NameTypeDescription
agent_llmDropdownThe provider of the language model that the agent uses to generate responses. Options include OpenAI and other providers or Custom.
system_promptStringThe system prompt provides initial instructions and context to guide the agent's behavior.
toolsListThe list of tools available for the agent to use.
input_valueStringThe input task or question for the agent to process.
add_current_date_toolBooleanWhen true this adds a tool to the agent that returns the current date.
memoryMemoryAn optional memory configuration for maintaining conversation history.
max_iterationsIntegerThe maximum number of iterations the agent can perform.
handle_parsing_errorsBooleanThis determines whether to handle parsing errors during agent execution.
verboseBooleanThis enables verbose output for detailed logging.

Outputs

NameTypeDescription
responseMessageThe agent's response to the given input task.

Legacy components

Legacy components are available for use but are no longer supported.

JSON Agent

This component creates a JSON agent from a JSON or YAML file and an LLM.

Parameters

Inputs

NameTypeDescription
llmLanguageModelThe language model to use for the agent.
pathFileThe path to the JSON or YAML file.

Outputs

NameTypeDescription
agentAgentExecutorThe JSON agent instance.

Vector Store Agent

This component creates a Vector Store Agent using LangChain.

Parameters

Inputs

NameTypeDescription
llmLanguageModelThe language model to use for the agent.
vectorstoreVectorStoreInfoThe vector store information for the agent to use.

Outputs

NameTypeDescription
agentAgentExecutorThe Vector Store Agent instance.

Vector Store Router Agent

This component creates a Vector Store Router Agent using LangChain.

Parameters

Inputs

NameTypeDescription
llmLanguageModelThe language model to use for the agent.
vectorstoresList[VectorStoreInfo]The list of vector store information for the agent to route between.

Outputs

NameTypeDescription
agentAgentExecutorThe Vector Store Router Agent instance.

Moved components

The following components are available under Bundles.

CrewAI Agent

This component represents an Agent of CrewAI allowing for the creation of specialized AI agents with defined roles goals and capabilities within a crew.

For more information, see the CrewAI documentation.

Parameters

Inputs

NameDisplay NameInfo
roleRoleThe role of the agent.
goalGoalThe objective of the agent.
backstoryBackstoryThe backstory of the agent.
toolsToolsThe tools at the agent's disposal.
llmLanguage ModelThe language model that runs the agent.
memoryMemoryThis determines whether the agent should have memory or not.
verboseVerboseThis enables verbose output.
allow_delegationAllow DelegationThis determines whether the agent is allowed to delegate tasks to other agents.
allow_code_executionAllow Code ExecutionThis determines whether the agent is allowed to execute code.
kwargskwargsAdditional keyword arguments for the agent.

Outputs

NameDisplay NameInfo
outputAgentThe constructed CrewAI Agent object.

Hierarchical Crew

This component represents a group of agents managing how they should collaborate and the tasks they should perform in a hierarchical structure. This component allows for the creation of a crew with a manager overseeing the task execution.

For more information, see the CrewAI documentation.

Parameters

Inputs

NameDisplay NameInfo
agentsAgentsThe list of Agent objects representing the crew members.
tasksTasksThe list of HierarchicalTask objects representing the tasks to be executed.
manager_llmManager LLMThe language model for the manager agent.
manager_agentManager AgentThe specific agent to act as the manager.
verboseVerboseThis enables verbose output for detailed logging.
memoryMemoryThe memory configuration for the crew.
use_cacheUse CacheThis enables caching of results.
max_rpmMax RPMThis sets the maximum requests per minute.
share_crewShare CrewThis determines if the crew information is shared among agents.
function_calling_llmFunction Calling LLMThe language model for function calling.

Outputs

NameDisplay NameInfo
crewCrewThe constructed Crew object with hierarchical task execution.

CSV Agent

This component creates a CSV agent from a CSV file and LLM.

Parameters

Inputs

NameTypeDescription
llmLanguageModelThe language model to use for the agent.
pathFileThe path to the CSV file.
agent_typeStringThe type of agent to create.

Outputs

NameTypeDescription
agentAgentExecutorThe CSV agent instance.

OpenAI Tools Agent

This component creates an OpenAI Tools Agent.

Parameters

Inputs

NameTypeDescription
llmLanguageModelThe language model to use.
toolsList of ToolsThe tools to give the agent access to.
system_promptStringThe system prompt to provide context to the agent.
input_valueStringThe user's input to the agent.
memoryMemoryThe memory for the agent to use for context persistence.
max_iterationsIntegerThe maximum number of iterations to allow the agent to execute.
verboseBooleanThis determines whether to print out the agent's intermediate steps.
handle_parsing_errorsBooleanThis determines whether to handle parsing errors in the agent.

Outputs

NameTypeDescription
agentAgentExecutorThe OpenAI Tools agent instance.
outputStringThe output from executing the agent on the input.

OpenAPI Agent

This component creates an agent for interacting with OpenAPI services.

Parameters

Inputs

NameTypeDescription
llmLanguageModelThe language model to use.
openapi_specStringThe OpenAPI specification for the service.
base_urlStringThe base URL for the API.
headersDictThe optional headers for API requests.
agent_executor_kwargsDictThe optional parameters for the agent executor.

Outputs

NameTypeDescription
agentAgentExecutorThe OpenAPI agent instance.

Sequential Crew

This component represents a group of agents with tasks that are executed sequentially. This component allows for the creation of a crew that performs tasks in a specific order.

For more information, see the CrewAI documentation.

Parameters

Inputs

NameDisplay NameInfo
tasksTasksThe list of SequentialTask objects representing the tasks to be executed.
verboseVerboseThis enables verbose output for detailed logging.
memoryMemoryThe memory configuration for the crew.
use_cacheUse CacheThis enables caching of results.
max_rpmMax RPMThis sets the maximum requests per minute.
share_crewShare CrewThis determines if the crew information is shared among agents.
function_calling_llmFunction Calling LLMThe language model for function calling.

Outputs

NameDisplay NameInfo
crewCrewThe constructed Crew object with sequential task execution.

Sequential task agent

This component creates a CrewAI Task and its associated Agent allowing for the definition of sequential tasks with specific agent roles and capabilities.

For more information, see the CrewAI documentation.

Parameters

Inputs

NameDisplay NameInfo
roleRoleThe role of the agent.
goalGoalThe objective of the agent.
backstoryBackstoryThe backstory of the agent.
toolsToolsThe tools at the agent's disposal.
llmLanguage ModelThe language model that runs the agent.
memoryMemoryThis determines whether the agent should have memory or not.
verboseVerboseThis enables verbose output.
allow_delegationAllow DelegationThis determines whether the agent is allowed to delegate tasks to other agents.
allow_code_executionAllow Code ExecutionThis determines whether the agent is allowed to execute code.
agent_kwargsAgent kwargsThe additional kwargs for the agent.
task_descriptionTask DescriptionThe descriptive text detailing the task's purpose and execution.
expected_outputExpected Task OutputThe clear definition of the expected task outcome.
async_executionAsync ExecutionThe boolean flag indicating asynchronous task execution.
previous_taskPrevious TaskThe previous task in the sequence for chaining.

Outputs

NameDisplay NameInfo
task_outputSequential TaskThe list of SequentialTask objects representing the created tasks.

SQL Agent

This component creates an agent for interacting with SQL databases.

Parameters

Inputs

NameTypeDescription
llmLanguageModelThe language model to use.
databaseDatabaseThe SQL database connection.
top_kIntegerThe number of results to return from a SELECT query.
use_toolsBooleanThis determines whether to use tools for query execution.
return_intermediate_stepsBooleanThis determines whether to return the agent's intermediate steps.
max_iterationsIntegerThe maximum number of iterations to run the agent.
max_execution_timeIntegerThe maximum execution time in seconds.
early_stopping_methodStringThe method to use for early stopping.
verboseBooleanThis determines whether to print the agent's thoughts.

Outputs

NameTypeDescription
agentAgentExecutorThe SQL agent instance.

Tool Calling Agent

This component creates an agent for structured tool calling with various language models.

Parameters

Inputs

NameTypeDescription
llmLanguageModelThe language model to use.
toolsList[Tool]The list of tools available to the agent.
system_messageStringThe system message to use for the agent.
return_intermediate_stepsBooleanThis determines whether to return the agent's intermediate steps.
max_iterationsIntegerThe maximum number of iterations to run the agent.
max_execution_timeIntegerThe maximum execution time in seconds.
early_stopping_methodStringThe method to use for early stopping.
verboseBooleanThis determines whether to print the agent's thoughts.

Outputs

NameTypeDescription
agentAgentExecutorThe tool calling agent instance.

XML Agent

This component creates an XML Agent using LangChain.

The agent uses XML formatting for tool instructions to the Language Model.

Parameters

Inputs

NameTypeDescription
llmLanguageModelThe language model to use for the agent.
user_promptStringThe custom prompt template for the agent with XML formatting instructions.
toolsList[Tool]The list of tools available to the agent.

Outputs

NameTypeDescription
agentAgentExecutorThe XML Agent instance.
Search